<?php

session_start();

if (!isset($_POST)) {
    exit('非法访问');
} elseif (!isset($_POST['type'])) {
    exit('非法访问');
}

require_once './admin/admin-core/admin-function.php';
$admin_sql = new TOAdminSQL();

switch ($_POST['type']) {
    case 'add-news-html':
        if (!isset($_POST['id'])) exit(json_encode(['status' => 1, 'error' => 'don\'t have 2 items']));
        $insert_res = $admin_sql->add_news_html($_POST['id']);
        exit(json_encode($insert_res));
        break;
    default:
}